#ifndef ROBOT_CMD_H
#define ROBOT_CMD_H

#include "cmd_dist.h"

class RobotCmd : public CmdDist {
public:
    RobotCmd() : CmdDist("Robot Cmd") {}

private:
    int Power(int a)
    {
        cout << (a * a) << endl;
        return 0;
    }

    int Double(int a)
    {
        cout << (a << 1) << endl;
        return 0;
    }

    int ShowModule(int a)
    {
        (void)a;
        cout << m_module << endl;
        return 0;
    }

    map<string, CmdHandler> *GetCmds() override
    {
        return &m_cmds;
    }

private:
    map<string, CmdHandler> m_cmds = {
        {"Power", {BIND_FUNCTION(&RobotCmd::Power), "Power,a"}},
        {"Double", {BIND_FUNCTION(&RobotCmd::Double), "Double,a"}},
        {"ShowModule", {BIND_FUNCTION(&RobotCmd::ShowModule), "ShowModule"}},
    };
};

#endif
